Skip to content

perf: optimize KeyMatch functions with fast path for wildcard replacement#1699

Open
AKonnyaku wants to merge 1 commit intoapache:masterfrom
AKonnyaku:builtin-op-test
Open

perf: optimize KeyMatch functions with fast path for wildcard replacement#1699
AKonnyaku wants to merge 1 commit intoapache:masterfrom
AKonnyaku:builtin-op-test

Conversation

@AKonnyaku
Copy link
Contributor

This pull request optimizes the performance of path matching functions in the utility package.

  • The casbin library heavily relies on functions like KeyMatch2 through KeyMatch5 for policy enforcement.
  • Profiling analysis revealed that strings.Replace was executing unconditionally, consuming unnecessary CPU cycles.
  • We implemented a fast path check using strings.Contains to verify wildcard existence before attempting replacement.
  • This engineering change effectively reduces overhead for keys that do not require modification.
  • The optimization is validated against upstream benchmarks, specifically BenchmarkRBACModelWithDomainPatternLarge .
  • Linter directives //nolint:gosimple are added to explain the intentional code structure for performance gains.

…ment

This change introduces a fast path optimization for KeyMatch2, KeyMatch3, KeyMatch4, KeyMatch5 and their corresponding KeyGet functions.

Original code (unconditional replacement):
key2 = strings.Replace(key2, "/*", "/.*", -1)

Optimized code (conditional replacement):
if strings.Contains(key2, "/*") { //nolint:gosimple // optimization
    key2 = strings.Replace(key2, "/*", "/.*", -1)
}

This avoids unnecessary allocations and processing when the key does not contain a wildcard, as verified by upstream benchmarks using test data like 'examples/performance/rbac_with_pattern_large_scale_policy.csv'.
@github-actions
Copy link

Benchmark Comparison

Comparing base branch (0fe9505)
vs PR branch (4b96cc2)

goos: linux
goarch: amd64
pkg: github.com/casbin/casbin/v3
cpu: AMD EPYC 7763 64-Core Processor                
                                                 │ base-bench.txt │             pr-bench.txt              │
                                                 │     sec/op     │    sec/op      vs base                     Diff          │
CachedRaw                                          15.41n ± ∞ ¹    15.06n ± ∞ ¹       ~ (p=1.000 n=1) ²        -2.27% ➡️
CachedBasicModel                                   177.2n ± ∞ ¹    167.5n ± ∞ ¹       ~ (p=1.000 n=1) ²        -5.47% ➡️
CachedRBACModel                                    177.2n ± ∞ ¹    171.8n ± ∞ ¹       ~ (p=1.000 n=1) ²        -3.05% ➡️
CachedRBACModelSmall                               181.8n ± ∞ ¹    173.5n ± ∞ ¹       ~ (p=1.000 n=1) ²        -4.57% ➡️
CachedRBACModelMedium                              186.5n ± ∞ ¹    188.8n ± ∞ ¹       ~ (p=1.000 n=1) ²        +1.23% ➡️
CachedRBACModelLarge                               160.2n ± ∞ ¹    154.2n ± ∞ ¹       ~ (p=1.000 n=1) ²        -3.75% ➡️
CachedRBACModelWithResourceRoles                   175.3n ± ∞ ¹    166.8n ± ∞ ¹       ~ (p=1.000 n=1) ²        -4.85% ➡️
CachedRBACModelWithDomains                         181.7n ± ∞ ¹    175.3n ± ∞ ¹       ~ (p=1.000 n=1) ²        -3.52% ➡️
CachedABACModel                                    2.799µ ± ∞ ¹    2.703µ ± ∞ ¹       ~ (p=1.000 n=1) ²        -3.43% ➡️
CachedKeyMatchModel                                194.4n ± ∞ ¹    184.7n ± ∞ ¹       ~ (p=1.000 n=1) ²        -4.99% ➡️
CachedRBACModelWithDeny                            175.8n ± ∞ ¹    165.6n ± ∞ ¹       ~ (p=1.000 n=1) ²        -5.80% ➡️
CachedPriorityModel                                175.2n ± ∞ ¹    167.4n ± ∞ ¹       ~ (p=1.000 n=1) ²        -4.45% ➡️
CachedWithEnforceContext                           245.7n ± ∞ ¹    225.5n ± ∞ ¹       ~ (p=1.000 n=1) ²        -8.22% ➡️
CachedRBACModelMediumParallel                      172.7n ± ∞ ¹    162.5n ± ∞ ¹       ~ (p=1.000 n=1) ²        -5.91% ➡️
HasPolicySmall                                     451.2n ± ∞ ¹    423.5n ± ∞ ¹       ~ (p=1.000 n=1) ²        -6.14% ➡️
HasPolicyMedium                                    464.4n ± ∞ ¹    448.4n ± ∞ ¹       ~ (p=1.000 n=1) ²        -3.45% ➡️
HasPolicyLarge                                     496.6n ± ∞ ¹    473.3n ± ∞ ¹       ~ (p=1.000 n=1) ²        -4.69% ➡️
AddPolicySmall                                     552.2n ± ∞ ¹    522.8n ± ∞ ¹       ~ (p=1.000 n=1) ²        -5.32% ➡️
AddPolicyMedium                                    653.8n ± ∞ ¹    759.8n ± ∞ ¹       ~ (p=1.000 n=1) ²        +16.21% 🐌
AddPolicyLarge                                     1.209µ ± ∞ ¹    1.231µ ± ∞ ¹       ~ (p=1.000 n=1) ²        +1.82% ➡️
RemovePolicySmall                                  516.6n ± ∞ ¹    513.4n ± ∞ ¹       ~ (p=1.000 n=1) ²        -0.62% ➡️
RemovePolicyMedium                                 556.3n ± ∞ ¹    556.4n ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.02% ➡️
RemovePolicyLarge                                  624.5n ± ∞ ¹    585.4n ± ∞ ¹       ~ (p=1.000 n=1) ²        -6.26% ➡️
Raw                                                15.09n ± ∞ ¹    15.38n ± ∞ ¹       ~ (p=1.000 n=1) ²        +1.92% ➡️
BasicModel                                         3.673µ ± ∞ ¹    3.673µ ± ∞ ¹       ~ (p=1.000 n=1) ³        +0.00% ➡️
RBACModel                                          5.430µ ± ∞ ¹    5.455µ ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.46% ➡️
RBACModelSizes/small                               50.91µ ± ∞ ¹    48.39µ ± ∞ ¹       ~ (p=1.000 n=1) ²        -4.95% ➡️
RBACModelSizes/medium                              494.8µ ± ∞ ¹    483.4µ ± ∞ ¹       ~ (p=1.000 n=1) ²        -2.30% ➡️
RBACModelSizes/large                               5.479m ± ∞ ¹    5.611m ± ∞ ¹       ~ (p=1.000 n=1) ²        +2.41% ➡️
RBACModelSmall                                     60.11µ ± ∞ ¹    57.70µ ± ∞ ¹       ~ (p=1.000 n=1) ²        -4.01% ➡️
RBACModelMedium                                    565.4µ ± ∞ ¹    567.7µ ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.41% ➡️
RBACModelLarge                                     5.929m ± ∞ ¹    5.978m ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.83% ➡️
RBACModelWithResourceRoles                         4.501µ ± ∞ ¹    4.512µ ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.24% ➡️
RBACModelWithDomains                               5.140µ ± ∞ ¹    5.064µ ± ∞ ¹       ~ (p=1.000 n=1) ²        -1.48% ➡️
ABACModel                                          2.754µ ± ∞ ¹    2.741µ ± ∞ ¹       ~ (p=1.000 n=1) ²        -0.47% ➡️
ABACRuleModel                                      4.081m ± ∞ ¹    4.061m ± ∞ ¹       ~ (p=1.000 n=1) ²        -0.49% ➡️
KeyMatchModel                                      6.134µ ± ∞ ¹    6.084µ ± ∞ ¹       ~ (p=1.000 n=1) ²        -0.82% ➡️
RBACModelWithDeny                                  6.938µ ± ∞ ¹    6.951µ ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.19% ➡️
PriorityModel                                      4.274µ ± ∞ ¹    4.184µ ± ∞ ¹       ~ (p=1.000 n=1) ²        -2.11% ➡️
RBACModelWithDomainPatternLarge                    14.15µ ± ∞ ¹    12.93µ ± ∞ ¹       ~ (p=1.000 n=1) ²        -8.62% ➡️
RoleManagerSmall                                   48.37µ ± ∞ ¹    47.03µ ± ∞ ¹       ~ (p=1.000 n=1) ²        -2.77% ➡️
RoleManagerMedium                                  540.4µ ± ∞ ¹    543.8µ ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.63% ➡️
RoleManagerLarge                                   5.993m ± ∞ ¹    6.388m ± ∞ ¹       ~ (p=1.000 n=1) ²        +6.59% ➡️
BuildRoleLinksWithPatternLarge                     290.7m ± ∞ ¹    283.3m ± ∞ ¹       ~ (p=1.000 n=1) ²        -2.55% ➡️
BuildRoleLinksWithDomainPatternLarge               9.300m ± ∞ ¹    9.211m ± ∞ ¹       ~ (p=1.000 n=1) ²        -0.96% ➡️
BuildRoleLinksWithPatternAndDomainPatternLarge     297.6m ± ∞ ¹    293.2m ± ∞ ¹       ~ (p=1.000 n=1) ²        -1.48% ➡️
HasLinkWithPatternLarge                            991.1n ± ∞ ¹   1007.0n ± ∞ ¹       ~ (p=1.000 n=1) ²        +1.60% ➡️
HasLinkWithDomainPatternLarge                      339.4n ± ∞ ¹    346.3n ± ∞ ¹       ~ (p=1.000 n=1) ²        +2.03% ➡️
HasLinkWithPatternAndDomainPatternLarge            992.7n ± ∞ ¹   1003.0n ± ∞ ¹       ~ (p=1.000 n=1) ²        +1.04% ➡️
ConcurrentHasLinkWithMatching                      1.253µ ± ∞ ¹    1.174µ ± ∞ ¹       ~ (p=1.000 n=1) ²        -6.30% ➡️
geomean                                              5.048µ          4.955µ                                    -1.84% ➡️
¹ need >= 6 samples for confidence interval at level 0.95
² need >= 4 samples to detect a difference at alpha level 0.05
³ all samples are equal

                                                 │ base-bench.txt │             pr-bench.txt              │
                                                 │      B/op      │     B/op       vs base                     Diff          │
CachedRaw                                           0.000 ± ∞ ¹     0.000 ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.00% ➡️
CachedBasicModel                                    104.0 ± ∞ ¹     104.0 ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.00% ➡️
CachedRBACModel                                     104.0 ± ∞ ¹     104.0 ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.00% ➡️
CachedRBACModelSmall                                104.0 ± ∞ ¹     104.0 ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.00% ➡️
CachedRBACModelMedium                               104.0 ± ∞ ¹     104.0 ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.00% ➡️
CachedRBACModelLarge                                96.00 ± ∞ ¹     96.00 ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.00% ➡️
CachedRBACModelWithResourceRoles                    104.0 ± ∞ ¹     104.0 ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.00% ➡️
CachedRBACModelWithDomains                          120.0 ± ∞ ¹     120.0 ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.00% ➡️
CachedABACModel                                   1.517Ki ± ∞ ¹   1.509Ki ± ∞ ¹       ~ (p=1.000 n=1) ³        -0.53% ➡️
CachedKeyMatchModel                                 152.0 ± ∞ ¹     152.0 ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.00% ➡️
CachedRBACModelWithDeny                             104.0 ± ∞ ¹     104.0 ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.00% ➡️
CachedPriorityModel                                 104.0 ± ∞ ¹     104.0 ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.00% ➡️
CachedWithEnforceContext                            176.0 ± ∞ ¹     176.0 ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.00% ➡️
CachedRBACModelMediumParallel                       104.0 ± ∞ ¹     104.0 ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.00% ➡️
HasPolicySmall                                      102.0 ± ∞ ¹     102.0 ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.00% ➡️
HasPolicyMedium                                     109.0 ± ∞ ¹     109.0 ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.00% ➡️
HasPolicyLarge                                      117.0 ± ∞ ¹     117.0 ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.00% ➡️
AddPolicySmall                                      152.0 ± ∞ ¹     152.0 ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.00% ➡️
AddPolicyMedium                                     166.0 ± ∞ ¹     167.0 ± ∞ ¹       ~ (p=1.000 n=1) ³        +0.60% ➡️
AddPolicyLarge                                      406.0 ± ∞ ¹     389.0 ± ∞ ¹       ~ (p=1.000 n=1) ³        -4.19% ➡️
RemovePolicySmall                                   166.0 ± ∞ ¹     166.0 ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.00% ➡️
RemovePolicyMedium                                  174.0 ± ∞ ¹     174.0 ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.00% ➡️
RemovePolicyLarge                                   181.0 ± ∞ ¹     181.0 ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.00% ➡️
Raw                                                 0.000 ± ∞ ¹     0.000 ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.00% ➡️
BasicModel                                        1.491Ki ± ∞ ¹   1.490Ki ± ∞ ¹       ~ (p=1.000 n=1) ³        -0.07% ➡️
RBACModel                                         2.035Ki ± ∞ ¹   2.037Ki ± ∞ ¹       ~ (p=1.000 n=1) ³        +0.10% ➡️
RBACModelSizes/small                              19.84Ki ± ∞ ¹   19.83Ki ± ∞ ¹       ~ (p=1.000 n=1) ³        -0.05% ➡️
RBACModelSizes/medium                             187.2Ki ± ∞ ¹   187.0Ki ± ∞ ¹       ~ (p=1.000 n=1) ³        -0.11% ➡️
RBACModelSizes/large                              1.813Mi ± ∞ ¹   1.812Mi ± ∞ ¹       ~ (p=1.000 n=1) ³        -0.06% ➡️
RBACModelSmall                                    19.84Ki ± ∞ ¹   19.92Ki ± ∞ ¹       ~ (p=1.000 n=1) ³        +0.40% ➡️
RBACModelMedium                                   189.9Ki ± ∞ ¹   190.0Ki ± ∞ ¹       ~ (p=1.000 n=1) ³        +0.05% ➡️
RBACModelLarge                                    1.841Mi ± ∞ ¹   1.841Mi ± ∞ ¹       ~ (p=1.000 n=1) ³        +0.00% ➡️
RBACModelWithResourceRoles                        1.811Ki ± ∞ ¹   1.810Ki ± ∞ ¹       ~ (p=1.000 n=1) ³        -0.06% ➡️
RBACModelWithDomains                              1.801Ki ± ∞ ¹   1.804Ki ± ∞ ¹       ~ (p=1.000 n=1) ³        +0.17% ➡️
ABACModel                                         1.507Ki ± ∞ ¹   1.508Ki ± ∞ ¹       ~ (p=1.000 n=1) ³        +0.07% ➡️
ABACRuleModel                                     1.255Mi ± ∞ ¹   1.252Mi ± ∞ ¹       ~ (p=1.000 n=1) ³        -0.24% ➡️
KeyMatchModel                                     3.019Ki ± ∞ ¹   3.021Ki ± ∞ ¹       ~ (p=1.000 n=1) ³        +0.07% ➡️
RBACModelWithDeny                                 2.444Ki ± ∞ ¹   2.446Ki ± ∞ ¹       ~ (p=1.000 n=1) ³        +0.08% ➡️
PriorityModel                                     1.738Ki ± ∞ ¹   1.738Ki ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.00% ➡️
RBACModelWithDomainPatternLarge                   8.692Ki ± ∞ ¹   8.691Ki ± ∞ ¹       ~ (p=1.000 n=1) ³        -0.01% ➡️
RoleManagerSmall                                    800.0 ± ∞ ¹     800.0 ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.00% ➡️
RoleManagerMedium                                 13.63Ki ± ∞ ¹   13.63Ki ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.00% ➡️
RoleManagerLarge                                  224.6Ki ± ∞ ¹   224.6Ki ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.00% ➡️
BuildRoleLinksWithPatternLarge                    60.82Mi ± ∞ ¹   60.83Mi ± ∞ ¹       ~ (p=1.000 n=1) ³        +0.02% ➡️
BuildRoleLinksWithDomainPatternLarge              3.950Mi ± ∞ ¹   3.950Mi ± ∞ ¹       ~ (p=1.000 n=1) ³        +0.00% ➡️
BuildRoleLinksWithPatternAndDomainPatternLarge    62.47Mi ± ∞ ¹   62.46Mi ± ∞ ¹       ~ (p=1.000 n=1) ³        -0.02% ➡️
HasLinkWithPatternLarge                             112.0 ± ∞ ¹     112.0 ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.00% ➡️
HasLinkWithDomainPatternLarge                       16.00 ± ∞ ¹     16.00 ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.00% ➡️
HasLinkWithPatternAndDomainPatternLarge             112.0 ± ∞ ¹     112.0 ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.00% ➡️
ConcurrentHasLinkWithMatching                       736.0 ± ∞ ¹     736.0 ± ∞ ¹       ~ (p=1.000 n=1) ²        +0.00% ➡️
geomean                                                         ⁴                                              -0.08% ➡️               ⁴
¹ need >= 6 samples for confidence interval at level 0.95
² all samples are equal
³ need >= 4 samples to detect a difference at alpha level 0.05
⁴ summaries must be >0 to compute geomean

                                                 │ base-bench.txt │             pr-bench.txt             │
                                                 │   allocs/op    │  allocs/op    vs base                      Diff          │
CachedRaw                                           0.000 ± ∞ ¹    0.000 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
CachedBasicModel                                    4.000 ± ∞ ¹    4.000 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
CachedRBACModel                                     4.000 ± ∞ ¹    4.000 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
CachedRBACModelSmall                                4.000 ± ∞ ¹    4.000 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
CachedRBACModelMedium                               4.000 ± ∞ ¹    4.000 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
CachedRBACModelLarge                                3.000 ± ∞ ¹    3.000 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
CachedRBACModelWithResourceRoles                    4.000 ± ∞ ¹    4.000 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
CachedRBACModelWithDomains                          4.000 ± ∞ ¹    4.000 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
CachedABACModel                                     18.00 ± ∞ ¹    18.00 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
CachedKeyMatchModel                                 4.000 ± ∞ ¹    4.000 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
CachedRBACModelWithDeny                             4.000 ± ∞ ¹    4.000 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
CachedPriorityModel                                 4.000 ± ∞ ¹    4.000 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
CachedWithEnforceContext                            4.000 ± ∞ ¹    4.000 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
CachedRBACModelMediumParallel                       4.000 ± ∞ ¹    4.000 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
HasPolicySmall                                      4.000 ± ∞ ¹    4.000 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
HasPolicyMedium                                     4.000 ± ∞ ¹    4.000 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
HasPolicyLarge                                      5.000 ± ∞ ¹    5.000 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
AddPolicySmall                                      6.000 ± ∞ ¹    6.000 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
AddPolicyMedium                                     7.000 ± ∞ ¹    7.000 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
AddPolicyLarge                                      9.000 ± ∞ ¹    9.000 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
RemovePolicySmall                                   7.000 ± ∞ ¹    7.000 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
RemovePolicyMedium                                  7.000 ± ∞ ¹    7.000 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
RemovePolicyLarge                                   8.000 ± ∞ ¹    8.000 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
Raw                                                 0.000 ± ∞ ¹    0.000 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
BasicModel                                          18.00 ± ∞ ¹    18.00 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
RBACModel                                           36.00 ± ∞ ¹    36.00 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
RBACModelSizes/small                                481.0 ± ∞ ¹    481.0 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
RBACModelSizes/medium                              4.829k ± ∞ ¹   4.829k ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
RBACModelSizes/large                               48.21k ± ∞ ¹   48.17k ± ∞ ¹       ~ (p=1.000 n=1) ³         -0.08% ➡️
RBACModelSmall                                      616.0 ± ∞ ¹    616.0 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
RBACModelMedium                                    6.016k ± ∞ ¹   6.016k ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
RBACModelLarge                                     60.08k ± ∞ ¹   60.08k ± ∞ ¹       ~ (p=1.000 n=1) ³         +0.00% ➡️
RBACModelWithResourceRoles                          28.00 ± ∞ ¹    28.00 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
RBACModelWithDomains                                26.00 ± ∞ ¹    26.00 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
ABACModel                                           17.00 ± ∞ ¹    17.00 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
ABACRuleModel                                      37.09k ± ∞ ¹   37.09k ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
KeyMatchModel                                       38.00 ± ∞ ¹    38.00 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
RBACModelWithDeny                                   50.00 ± ∞ ¹    50.00 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
PriorityModel                                       23.00 ± ∞ ¹    23.00 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
RBACModelWithDomainPatternLarge                     73.00 ± ∞ ¹    73.00 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
RoleManagerSmall                                    100.0 ± ∞ ¹    100.0 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
RoleManagerMedium                                  1.744k ± ∞ ¹   1.744k ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
RoleManagerLarge                                   19.74k ± ∞ ¹   19.74k ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
BuildRoleLinksWithPatternLarge                     3.560M ± ∞ ¹   3.560M ± ∞ ¹       ~ (p=1.000 n=1) ³         +0.00% ➡️
BuildRoleLinksWithDomainPatternLarge               120.2k ± ∞ ¹   120.2k ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
BuildRoleLinksWithPatternAndDomainPatternLarge     3.637M ± ∞ ¹   3.637M ± ∞ ¹       ~ (p=1.000 n=1) ³         +0.00% ➡️
HasLinkWithPatternLarge                             9.000 ± ∞ ¹    9.000 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
HasLinkWithDomainPatternLarge                       1.000 ± ∞ ¹    1.000 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
HasLinkWithPatternAndDomainPatternLarge             9.000 ± ∞ ¹    9.000 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
ConcurrentHasLinkWithMatching                       11.00 ± ∞ ¹    11.00 ± ∞ ¹       ~ (p=1.000 n=1) ²         +0.00% ➡️
geomean                                                         ⁴                                              -0.00% ➡️               ⁴
¹ need >= 6 samples for confidence interval at level 0.95
² all samples are equal
³ need >= 4 samples to detect a difference at alpha level 0.05
⁴ summaries must be >0 to compute geomean

🤖 This comment will be automatically updated with the latest benchmark results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant